<?php
function cadastra (){
	$a=new Usuario($id='',$email,$senha,$senha2,$nivel);
	
	if($a->getErro()!=''){
		return $a->getErro();
	}
	
	$conection=Conection::getConexao();
	$nlinhas=$conection->executeUpdate(
		"INSERT INTO `tb_usuario` (email, senha, nivel) VALUES (
		'',
		'".$a->getEmail()."',
		'".$a->getSenha()."',
		'".$a->getNivel()."'
		)"
	);
	
	$conection->close();
	
	session_start();
	$_SESSION['email']=$email;
	$_SESSION['senha']=$senha;


}
?>